package cn.edu.zju.gis.disasterBE.sever.entity.global;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;

import java.text.SimpleDateFormat;
import java.util.Date;

@Data
public class MyResponse<T> {
    @ApiModelProperty(value = "返回的内容")
    private T data;
    @ApiModelProperty(value = "是否成功",example = "true")
    private Boolean state;
    @ApiModelProperty(value = "错误信息")
    private String msg;
    @ApiModelProperty(value = "发生时间")
    private String happenTime;

    public MyResponse()
    {
        Date date = new Date(System.currentTimeMillis());
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
        happenTime = formatter.format(date);
    }


}
